<script>
	export default {
		globalData: {
      tn: 'bsy', // 客户标识，固定值
      appKey: 'lx0ed0a552bd73b2ed', // 客户appKey 固定值
      appSecret: '2b2f92a939592f33cea9e432350a19d560483ba8', // 客户appSecret 固定值
			tnId: 195,
      sId: 19501, // 客户订阅id，固定值
      debug: global.IS_DEV, // 是否打开H5的vconsole，仅开发阶段打开
      env: 'online', // 接口环境：beta测试，online生产
      associatedId: '' // 此处是您当前应用的用户唯一标识，譬如userId!（此处随机生成，仅做示例）
    },
		onLaunch: function(e) {
			// if (e.type == 1) { //门店端跳转
			// 	this.$urouter.navigateTo({
			// 		url: '/pagesMy/my/relevance/relevance',
			// 		params: {
			// 			code: e.code,
			// 			name: e.name,
			// 			imgUrl: e.imgUrl
			// 		}
			// 	});
			// } 
			// uni.setStorageSync('USER_TOKEN_BSY_Z', 'eyJhbGciOiJIUzUxMiJ9.eyJ1aWQiOm51bGwsInN1YiI6InVzZXIiLCJhdmF0YXJVcmwiOiJodHRwczovL3RoaXJkd3gucWxvZ28uY24vbW1vcGVuL3ZpXzMyL0RZQUlPZ3E4M2VvbWN5eVZMc3FuaWFqS2Y5WG5POFo1aWNNMkdCQll0d2ZQVDdCcnZVcjIxWmJmampJUlFhWHU3bHdXSTFnZkExdVhEQUFxSEVSR2JGMEEvMTMyIiwibmlja05hbWUiOiLlub_ov5wiLCJhZHZpc2VySWQiOm51bGwsInNleCI6MCwicm9sZXMiOlsiQlVZRVIiXSwiZXhwIjoxNjU2MjEzMjQ5LCJ1c2VySWQiOjI3LCJ1dWlkIjpudWxsLCJzaG9wVWlkIjpudWxsLCJ1c2VybmFtZSI6IuW5v-i_nCJ9.P1Hpl6d_hNWs0fpQgv2j2nGiKaKXitmlLXQA0M4NsYJG1phUXAxGW8qwQo0DbrX8Mp9RpK6TmqrK5Ki-yuo-kg');
			uni.getSystemInfo({
				success: function(res) {
					console.log(res, 6)
					let iphone = res.brand,
						screenHeight = res.screenHeight;
					let iphonex = ''
					if (iphone == "devtools") {
						iphone = 'iPhone'
					}
					if (iphone == "iPhone" && screenHeight > 811) {
						iphonex = 'iphonex'
					}
					console.log(iphonex, '24444444444444444444444')
					uni.setStorageSync('iphonex', iphonex) //获取是否苹果x机型
				}
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			this.listenForUpdates();//监听更新
		},
		onHide: function() {
			console.log('App Hide')
      //中医
		},
		methods: {
			//监听小程序是否有新版本需要更新
			listenForUpdates() {
				const updateManager = uni.getUpdateManager();
				updateManager.onCheckForUpdate(function(res) {
					// 请求完新版本信息的回调
					console.log(res.hasUpdate, '新版本回调');
					if (res.hasUpdate == true) {
						updateManager.onUpdateReady(function(res) {
							uni.showModal({
								title: '更新提示',
								content: '新版本已经准备好，是否重启应用？',
								success(res) {
									console.log(res, '新版本下载完')
									if (res.confirm) {
										// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
										updateManager.applyUpdate();
									}
								}
							});
						});
						updateManager.onUpdateFailed(function(res) {
							// 新的版本下载失败
							uni.showModal({
								title: '更新失败',
								content: '很抱歉未能更新成功。您可以尝试重新进入，或者在微信界面下拉，在最近使用中找到此此小程序，长按将其拖拽到底部删除按钮中，然后重新搜索小程序进入。给您带来的不便，深表歉意！',
								showCancel: false,
							});

						});
					}
				});
			}
		}
	}
</script>
<style lang="scss">
	@import "uview-ui/index.scss";
	@import "./common/css/base.css";

	// 按照高度瀑布流
	.waterfall-box {
		padding: 20rpx 10rpx;
		box-sizing: border-box;

		>view {
			padding: 0 10rpx;
		}
	}

	.h-flex-x {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: flex-start;
		align-items: flex-start;
		align-content: flex-start;

		&.h-flex-2 {
			>view {
				width: 50%;
			}
		}
	}

	.load-txt {
		padding: 0 0 20rpx 0;
		text-align: center;
		color: #999;
		font-size: 24rpx;
	}

	// end


	// index css 文件
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.tabBarStyle {
		width: 750upx;
		height: 203upx;
		text-align: center;
		position: fixed;
		z-index: 998;
		bottom: 0;
		background-size: 750upx 212upx;

		image {
			width: 80rpx;
			height: 80rpx;
			display: block;
			margin: 0 auto;
			margin-top: 36upx;
		}
	}

	// end
	.loading-box {
		position: fixed;
		top: 600upx;
		left: 340upx;
		z-index: 1000;
	}
	.disabledbg {
		background: none;
		background: #E2E1E2 !important;
	}

	/*每个页面公共css */
	.u-border-bottom:after {
		border: none;
	}

	page {
		// font-family: PingFangSC-Medium, PingFang SC;
		background: #F5F5F5;
	}

	button::after {
		border: none;
	}

	.pages {
		height: 100vh;
	}

	.pagebgf {
		height: 100vh;
		background: #fff;
	}

	.page-bgf {
		height: 100vh;
		background: #fff;
		overflow: auto;
	}

	.w720 {
		width: 720rpx;
		margin: 0 auto;
	}

	.font-size36 {
		font-size: 36upx;
	}

	uni-button:after {
		border: none;
	}


	.weui-flex {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
	}

	.weui-flex__item {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
	}

	.placeholder {
		height: 100%;
	}

	.clearfix:after {
		content: "";
		display: block;
		visibility: hidden;
		height: 0;
		clear: both;
	}

	.clearfix {
		//清除外边距塌陷
		zoom: 1;
	}

	.adddb {
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		background: rgba(0, 0, 0, 0.4);
		display: flex;
		z-index: 999999;
		align-items: center;
		flex-direction: column;
		font-size: 30rpx;
	}

	/* lb-picker公用样式 */
	.list-item {
		padding: 10px 15px;
		/* #ifndef APP-NVUE */
		display: flex;
		flex-direction: column;
		/* #endif */
	}

	.sub-title {
		color: $uni-text-color-grey;
		font-size: 12px;
	}

	.item-title {
		font-size: 16px;
	}

	.item-content {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.item-left {
		font-size: 16px;
		text-align: left;
	}

	.item-value {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		align-items: center;
	}

	.item-label {
		font-size: 16px;
	}

	.item-placeholder {
		color: $uni-text-color-grey;
		font-size: 16px;
	}

	.tips {
		color: $uni-color-error;
		font-size: 12px;
		padding-left: 16px;
		padding-right: 16px;
	}

	.radio-group {
		padding-bottom: 10px;
		padding-left: 16px;
		padding-right: 16px;
	}

	.flex-row-center {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
	}

	.grey-block {
		height: 10px;
		background-color: $uni-bg-color-grey;
	}

	/deep/ .lb-picker {
		.lb-picker-column-label {
			font-size: 30upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #000000;
			line-height: 45upx;
		}

		.lb-picker-column-active {
			.lb-picker-column-label {
				font-size: 34upx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #000000;
				line-height: 51upx;
			}
		}
	}

	/* end */
	/* ==================
	         模态窗口
	 ==================== */

	.cu-modal {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 999;
		opacity: 0;
		outline: 0;
		text-align: center;
		-ms-transform: scale(1.185);
		transform: scale(1.185);
		backface-visibility: hidden;
		perspective: 2000upx;
		background: rgba(0, 0, 0, 0.4);
		transition: all 0.3s ease-in-out 0s;
		pointer-events: none;
	}

	.cu-modal::before {
		content: "\200B";
		display: inline-block;
		height: 100%;
		vertical-align: middle;
	}

	.cu-modal.show {
		opacity: 1;
		transition-duration: 0.3s;
		-ms-transform: scale(1);
		transform: scale(1);
		overflow-x: hidden;
		overflow-y: auto;
		pointer-events: auto;
	}

	.cu-dialog {
		position: relative;
		display: inline-block;
		vertical-align: middle;
		margin-left: auto;
		margin-right: auto;
		width: 680upx;
		max-width: 100%;
		background-color: #f8f8f8;
		border-radius: 10upx;
		overflow: hidden;
	}

	.cu-modal.bottom-modal::before {
		vertical-align: bottom;
	}

	.cu-modal.bottom-modal .cu-dialog {
		width: 100%;
	}

	.cu-modal.bottom-modal {
		margin-bottom: -1000upx;
	}

	.cu-modal.bottom-modal.show {
		margin-bottom: 0;
	}

	.cu-modal.drawer-modal {
		transform: scale(1);
		display: flex;
	}

	.cu-modal.drawer-modal .cu-dialog {
		height: 100%;
		min-width: 200upx;
		border-radius: 0;
		margin: initial;
		transition-duration: 0.3s;
	}

	.cu-modal.drawer-modal.justify-start .cu-dialog {
		transform: translateX(-100%);
	}

	.cu-modal.drawer-modal.justify-end .cu-dialog {
		transform: translateX(100%);
	}

	.cu-modal.drawer-modal.show .cu-dialog {
		transform: translateX(0%);
	}

	.cu-modal .cu-dialog>.cu-bar:first-child .action {
		min-width: 100rpx;
		margin-right: 0;
		min-height: 100rpx;
	}

	// end
	.w702 {
		width: 702upx;
		margin: 0 auto;
		background: #fff;
	}

	.bgf5 {
		background: #F5F5F5;
	}
</style>
